#include "World.h"

#include "InputHandler.h"
#include "Utility.h"
#include "GameGlobals.h"
#include "Resources.h"

LINKCLASSTONAME("ent_world", World);

World::World(sf::RenderWindow *App) : BaseMoveable(App)
{
	DrawOrder = 0;

	BackGround.SetTexture(*Resources::Instance()->RequestImage("Desert"));
	BackGround.SetOrigin(512,512);
	BackGround.Scale(2,2);

	sf::Vector2<float> Pos(0, 0);
	SetPos(0,0);
}

World::~World(void)
{
}

void World::Think()
{
	//float delta = GameGlobals::Instance()->FrameTime;
	//SetAngularVel(2);
}

void World::Draw()
{
	float Offset = 1024.f;
	BackGround.SetPosition(GetSFMLPos() + sf::Vector2f(-Offset,Offset));
	pRender->Draw(BackGround);
	BackGround.SetPosition(GetSFMLPos() + sf::Vector2f(Offset,Offset));
	pRender->Draw(BackGround);
	BackGround.SetPosition(GetSFMLPos() + sf::Vector2f(-Offset,-Offset));
	pRender->Draw(BackGround);
	BackGround.SetPosition(GetSFMLPos() + sf::Vector2f(Offset,-Offset));
	pRender->Draw(BackGround);
}